﻿$(document).ready(function () {
    var editor;
    KindEditor.ready(function (K) {
        editor = KindEditor.create('#content', {
            resizeType: 2,
            uploadJson: '/System/Upload' // 相对于当前页面的路径
        });
    });
	$.ajax(
    {
    	url: "GetAboutUsArticle",
    	success: function (data) {
    	    editor.html(data.Content);
    		$("#id").val(data.ID);
    	},
    	error: function () {
    		alert("获取文章信息失败");
    	}
    });
});
function Save() {
	var html;
	$.ajax(
    {
    	url: "/AboutUs/SaveArticle",
    	data: { "ID": $("#id").val(), "Content": editor.html() },
    	success: function (data) {
    		if (data == 1) {
    			alert("修改成功");
    		}
    		else {
    			alert("修改失败");
    		}
    	},
    	error: function () {
    		alert("修改失败");
    	}
    }
    );
}